/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/14 22:30
  *
  * @file       hd_key.h
  * @brief      Head file of KEY hardware driver.
  *
  * @note       This file contains the hardware driver's function declaration
  *             for the KEY.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date           Author       Notes
  *   2024/6/14      Chris        the first version
  *
  ******************************************************************************
  */

#ifndef JXTECH_KEY_H
#define JXTECH_KEY_H

#include "stm32f4xx.h"
#include "pd_gpio.h"
#include "drivers.h"

typedef struct KeyDef Key;

struct KeyDef {
    GPIO *gpio;

    void (*init)(const Key *this);

    uint8_t (*getKeyNum)(const Key *this);
};

extern const struct KeyClass {
    Key *(*build)(GPIO *gpio);
} KeyBuilder;


#endif
